import request from '@/utils/request'
import type { CancelToken } from 'axios'

/**
 * 获取权限列表
 * @param params 
 * @param cancelToken 取消令牌
 * @returns 
 */
export function getPermissionList(params: any, cancelToken?: CancelToken) {
    return request.get({ 
        url: '/admin/system.permission/lists', 
        params,
        cancelToken 
    })
}

/**
 * 保存权限
 * @param data 
 * @returns 
 */
export function savePermission(data: any) {
    return request.post({ url: '/admin/system.permission/save', data })
}

/**
 * 更新权限
 * @param data 
 * @returns 
 */
export function updatePermission(data: any) {
    return request.post({ url: '/admin/system.permission/update', data })
}

